﻿@model MSAcademic.v2.Web.Areas.Admin.Models.Login.ResetPasswordModel

@{
    ViewBag.Title = "Promjena lozinke";
}

<img src="~/Areas/Admin/Content/Images/admin-logo.png" />

@if (Model.IsFormSuccess || !Model.IsTokenVerified)
{
    <h2>Promjena lozinke</h2>
}
else if (Model.IsTokenVerified && !Model.IsFormSuccess)
{
    <h2>Promjena lozinke za korisnika @Model.User.Username</h2>
}

@if (Model.IsFormSuccess)
{
    <p>Vaša lozinka je uspješno promijenjena! @Html.RouteLink("Prijavite se", "SignIn") </p>
    <div>@Html.RouteLink("Povratak na naslovnicu", "Index")</div>
}
else if (!Model.IsTokenVerified)
{
    <p>Token ne postoji ili je istekao! Ako i dalje želite promijeniti lozinku kliknite @Html.RouteLink("ovdje", "RequestPasswordReset")</p>
    <div>@Html.RouteLink("Povratak na naslovnicu", "Index")</div>
}
else if (Model.IsTokenVerified && !Model.IsFormSuccess)
{
    using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()

        @Html.LabelFor(x => x.NewPassword, "Nova lozinka ")
        @Html.EditorFor(x => x.NewPassword)
        @Html.ValidationMessageFor(x => x.NewPassword)
        
        @Html.LabelFor(x => x.RepeatedNewPassword, "Ponovljena nova lozinka: ")
        @Html.EditorFor(x => x.RepeatedNewPassword)
        @Html.ValidationMessageFor(x => x.RepeatedNewPassword)
        
        <div class="actions-wrapper"> 
            <a href="@Url.RouteUrl("AdminSignIn")" class="cancel">Odustani</a> 
            <a class="positive submit">Re-re-resetiraj <i class="icon-refresh"></i></a> 
        </div>              
    }
}